<?php 
/**
 * Global Configuration form page. Used in update action in GlobalConfigurationController.
 *
 * @package   views
 * @subpackage globalConfiguration
 * @since     1.0
 * @filesource
 */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'global-configuration-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		
		<?php echo $model->title; ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $model->description; ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'value'); ?>
		<?php 
		switch ($model->type){
			case GlobalConfiguration::TYPE_BOOLEAN:
				echo $form->dropDownList($model,'value',DataUtil::getOptionYesNo());
				break;
			case GlobalConfiguration::TYPE_STRING:
				echo $form->textArea($model,'value',array('rows'=>6, 'cols'=>50));
				break;
		}	 
		?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'lastValue'); ?>
		<?php echo $model->getReadableValue(true);?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->